<meta title="新增淘宝物料分类" args="taobaoMaterialCat" width="600"/>
<style>
</style>
<form s="valid,form,nda,datac"
      method="post"
      s-data="taobaoMaterialCat"taobaoMaterialCat
      action="/api/taobao-material-cat"
      id="form" class="form-horizontal">
    <table class="table">
        <tr>
            <td>物料分类名</td>
            <td>
                <input autocomplete="off" type="text" name="name" s-valid-error="require()" class="form-control" placeholder="物料分类名">
            </td>
        </tr>
    </table>
</form>
<script>
    if(taobaoMaterialCat) {
      $form.node.attr('method', 'put').attr('action', '/api/taobao-material-cat/' + taobaoMaterialCat.id)
      S.meta.title = '编辑淘宝物料分类'
    }
    S.meta.btns = [
        {
            name: "确定",
            style: "btn btn-primary",
            click: function() {
                return $form.submit().done(function() {
                    S.close(true)
                })
            }
        },
        {
            name: "关闭",
            style: "btn btn-default",
            click: function() {
                S.close();
            }
        }
    ]

</script>